﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Configuration;

namespace Musicman.Utilities.Configuration.Search
{
    public class SearchJobsConfigurationSection : ConfigurationSection
    {

        [ConfigurationProperty("searchmode", IsRequired = false, DefaultValue = SearchMode.JobAtTheTime)]
        public SearchMode SearchMode
        {
            get { return (SearchMode)this["searchmode"]; }
            set { this["searchmode"] = value; }
        }

        [ConfigurationProperty("maxworkingthreads", IsRequired = false, DefaultValue = 20)]
        public int MaxWorkingThreads
        {
            get { return (int)this["maxworkingthreads"]; }
            set { this["maxworkingthreads"] = value; }
        }

        [ConfigurationProperty("maxworkingtimemin", IsRequired = false, DefaultValue = 10)]
        public int MaxWorkingTimeMin
        {
            get { return (int)this["maxworkingtimemin"]; }
            set { this["maxworkingtimemin"] = value; }
        }

        [ConfigurationProperty("deleteaftersequences", IsRequired = false, DefaultValue = 15)]
        public int DeletAafterSequences
        {
            get { return (int)this["deleteaftersequences"]; }
            set { this["deleteaftersequences"] = value; }
        }

        [ConfigurationProperty("jobs", IsDefaultCollection = true)]
        public SearchJobConfigurationCollection SearchJobs
        {
            get
            {
                SearchJobConfigurationCollection searchJobsConfigurationCollection =
                (SearchJobConfigurationCollection)base["jobs"];
                return searchJobsConfigurationCollection;
            }
        }

        [ConfigurationProperty("locations", IsDefaultCollection = false)]
        public SearchLoactionConfigurationCollection SearchLocations
        {
            get
            {
                SearchLoactionConfigurationCollection searchLocationCollection =
                (SearchLoactionConfigurationCollection)base["locations"];
                return searchLocationCollection;
            }
        }
    }
}
